package com.ldd.mybatis.service.impl;

import com.ldd.mybatis.mapper.DeptMapper;
import com.ldd.mybatis.model.Dept;
import com.ldd.mybatis.model.DeptAndEmp;
import com.ldd.mybatis.model.EmpAndDept;
import com.ldd.mybatis.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public Dept selectDeptById(int id) {
        return deptMapper.selectDeptById(id);
    }

    @Override
    public List<DeptAndEmp> selectDeptAndEmpById(String dName) {
        return deptMapper.selectDeptAndEmpById(dName);
    }
    @Override
    public List<EmpAndDept> selectEmpAndDept() {
        return deptMapper.selectEmpAndDept();
    }
}
